<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.zjf.util.Config"%>
<%@page import="java.io.File"%>
<%@page import="com.zjf.dao.impl.UserDaoImpl"%>
<%@page import="com.zjf.dao.UserDao"%>
<%@ include file="../config/config.jsp" %>
<%@include file="checkAdmin.jsp" %>
<%
UserDao dao = new UserDaoImpl();
List<User> users = dao.queryAllUsers();
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <style>
body {
	font:12px Arial, Helvetica, sans-serif;
	color: #000;
	background-color:#F0F0F0;
	margin: 0px;
	border:solid 1pt #CCCCCC;
	padding:50px 50px 50px 50px;
}
table,td{
 border:1pt #999999 solid;
}
</style>
   
    
    <title></title>
    
  </head>
  <body>
  <font size=2>
  	<table>
  		<tr>
  			<td>id</td><td>用户名</td><td>姓名</td><td>权限</td><td>性别</td><td>注册时间</td><td>授权</td><td>降级</td>
  		</tr>
  		<%	for(User u:users){ %>
  			<tr>
  				<td><%=u.getId() %></td><td><%=u.getUsername() %></td><td><%=u.getName() %></td><td><%=User.permissonName[u.getPermisson()] %></td><td><%=User.sexName[u.getSex()] %></td><td><%=u.getRegDate() %></td>
  				<td><a href="<%=request.getContextPath() %>/admin_promoteUser.do?id=<%=u.getId() %>">提升为写手</a>|
  					<a href="<%=request.getContextPath() %>/admin_promoteAdmin.do?id=<%=u.getId() %>">提升为管理员</a></td>
  				<td><a href="<%=request.getContextPath() %>/admin_removePermission.do?id=<%=u.getId() %>">降低为读者</a>|
  					<a href="<%=request.getContextPath() %>/admin_deleteUser.do?id=<%=u.getId() %>">删除用户</a></td>
  			</tr>
  		<%} %>
  	</table>
  </font>
  </body>
</html>
